﻿<!DOCTYPE html>
<html>
    <head>
        <title>Flower Shop - Cửa Hàng</title>
        <meta charset="UTF-8"> 
        <link rel="stylesheet" type="text/css" href="<?php echo asset_url() . 'css/style.css'; ?>" />
        <link rel="stylesheet" type="text/css" href="<?php echo asset_url() . 'css/lightbox.css'; ?>" />
        <link rel="stylesheet" type="text/css" href="<?php echo asset_url() . 'css/stylenav.css'; ?>" />
        <script type="text/javascript" src="<?php echo asset_url() . 'js/jquery-2.0.3.min.js'; ?>"></script>
        <link rel="stylesheet" type="text/css" href="<?php echo asset_url() . 'css/snoweffect.css'; ?>" />
        <script type="text/javascript">
            $(document).ready(function() {
                $(".thumb").click(function() {
//                       alert($("#NguyenLieu_" + $(this).attr("value")).attr("value"));
                    var strPrice = $("#Price_" + $(this).attr("value")).attr("value") + " vnd";
                    $("#DonGialb").html(strPrice);
                    var src = $(this).attr("src");
                    $("#imagelb").attr("src", src);
                    var strMT = $("#MoTa_" + $(this).attr("value")).attr("value");
                    $("#MoTalb").html(strMT);
                    var strNL = $("#NguyenLieu_" + $(this).attr("value")).attr("value");
                    $("#NguyenLieulb").html(strNL);
                    $("#i1").css({"display": "block", "opacity": "1", "z-index": "300", "margin-top": "60px"});
                    $("#submitlb").attr("val", $(this).attr("value"));
                });
                $("#close_frm").click(function() {
                    $("#i1").css({"display": "none"});
                });

                $(window).scroll(function() {
                    $("#lightbox").css({"top": ($(window).scrollTop()) + "px"});
                });
                $(document).keyup(function(e) {
                    if (e.which === 27)
                    {
                        $("#i1").css({"display": "none"});
                    }
                });
                $("#submitlb").click(function() {
                    //  alert("#sm_" + $(this).attr("val"));
                    $("#sm_" + $(this).attr("val")).click();
                });
            });
        </script>

    </head>
    <body>
        <div id="wrap"><?php
            if ($this->session->userdata("MaQuyen") == 1) {
                include '/layout/header_admin.php';
            } else {
                include '/layout/header.php';
            }
            ?>
            <div class="center_content">
                <div id="lightbox">
                    <div id="i1">                        
                        <img id="imagelb" src="#" width="300" alt="" />
                        <p id="MoTalb"></p>
                        <label style="font-weight: bold;color: green;">Thông Tin Sản Phẩm</label>
                        <p id="NguyenLieulb"></p>
                        <p id="DonGialb" style="text-decoration-style: solid;text-align: center; font-weight: bold; font-size: 15px;color: green"></p>
                        <input type="submit" id="submitlb" value="" val="" class="submitlb"/>
                        <a id="close_frm"></a>                
                    </div>                                    
                </div>
                <div class="left_content">

                    <!--                    <div class="crumb_nav"> <a href="http://all-free-download.com/free-website-templates/">Trang Chủ</a> &gt;&gt; category name </div>-->
                    <div class="title">
                        <span class="title_icon">
                            <?php echo img(asset_url() . 'imgs/bullet1.gif', TRUE); ?>
                        </span>
                        Danh Mục Sản Phẩm
                    </div>
                    <div class="new_products">                        
                        <?php
                        if (isset($hoa)) {
                            foreach ($hoa as $val) {
                                $val = (object) $val;
                                $MaHoa = $val->MaHoa;
                                $TenHoa = $val->TenHoa;
                                $MaLoaiHoa = $val->MaLoaiHoa;
                                $MaMauSac = $val->MaMauSac;
                                $HinhAnh = $val->HinhAnh;
                                $SoLuong = $val->SoLuong;
                                $DonGia = $val->DonGia;
                                $NguyenLieu = $val->NguyenLieu;
                                $MoTa = $val->MoTa;
                                ?>
                                <div  class="new_prod_box">
                                    <div class="new_prod_bg"> 
                                        <?php echo form_open('shopping/add'); ?>                                        
                                        <span class="new_icon"><?php echo img(asset_url() . 'imgs/promo_icon.gif', TRUE); ?></span>                                      
                                        <img src="<?php echo asset_url() . "$HinhAnh"; ?>" value="<?php echo $MaHoa; ?>" width="150px" class="thumb" border="0" />
                                        <label class="name_prod"><?php echo "$TenHoa"; ?></label>
                                        <br/>
                                        <span class="price"><?php echo "$DonGia"; ?></span>
                                        <br/>
                                        <?php echo form_hidden('id', $MaHoa) ?>
                                        <input type="hidden" name="MoTa_<?php echo $MaHoa; ?>" id="MoTa_<?php echo $MaHoa; ?>" value="<?php echo "$MoTa"; ?>">
                                        <input type="hidden" name="Price_<?php echo $MaHoa; ?>" id="Price_<?php echo $MaHoa; ?>" value="<?php echo "$DonGia"; ?>">
                                        <input type="hidden" name="NguyenLieu_<?php echo $MaHoa; ?>" id="NguyenLieu_<?php echo $MaHoa; ?>" value="<?php echo "$NguyenLieu"; ?>">
                                        <input id="sm_<?php echo $MaHoa; ?>" class="submit" value="" type="submit"/>
                                        <?php echo form_close(); ?>
                                    </div>
                                </div>                                
                                <?php
                            }
                        }
                        ?>
                        <div class = "clear"></div>
                        <div class="pagination">
                            <?php
                            echo $this->pagination->create_links(); // tạo link phân trang 
                            ?>
                        </div>
                        <div class="clear"></div>
    <!--                        <div style="clear: both;" class="pagination"> <span class="disabled"><<</span><span class="current">1</span><a href="http://all-free-download.com/free-website-templates/">2</a><a href="http://all-free-download.com/free-website-templates/">3</a>…<a href="http://all-free-download.com/free-website-templates/">10</a><a href="http://all-free-download.com/free-website-templates/">11</a><a href="http://all-free-download.com/free-website-templates/">>></a> </div>-->
                    </div>
                    <div class="clear"></div>
                </div>
                <!--end of left content-->
                <div class="right_content">
                    <div class="languages_box"> <span class="red">Ngôn Ngữ:</span> <a href="http://all-free-download.com/free-website-templates/" class="selected"><?php echo img(asset_url() . 'imgs/vn.bmp', TRUE); ?></a> <a href="http://all-free-download.com/free-website-templates/"><?php echo img(asset_url() . 'imgs/gb.gif', TRUE); ?></a></div>
                    <div class="cart">
                        <div class="title"><span class="title_icon"><?php echo img(asset_url() . 'imgs/cart.gif', TRUE); ?></span><a style="text-decoration:none" href="shopping">Giỏ Hàng</a></div>
                        <div class="home_cart_content"> <?php echo ($this->cart->total_items()); ?> x items | <span class="red">TOTAL: <?php echo($this->cart->total()); ?> VND</span> </div>
                    </div>
                    <div class="title"><span class="title_icon"><?php echo img(asset_url() . 'imgs/bullet3.gif', TRUE); ?></span>Tìm Kiếm</div>
                    <div class="search">
                        <?php
                        echo form_open('search/execute_search');
                        echo form_input(array('name' => 'search'));
                        ?>
                        <br></br>
                        <?php
                        echo form_submit('search_submit', 'Tìm Kiếm');
                        echo form_close();
                        ?>
                    </div>
                    <div class="right_box">
                        <div class="title"><span class="title_icon"><?php echo img(asset_url() . 'imgs/bullet5.gif', TRUE); ?></span>Danh Mục</div>
                        <ul class="list">
                            <?php
                            if (isset($category)) {

                                foreach ($category as $val) {
                                    //$val = (object) $val;
                                    $loaihoa = $val->TenLoaiHoa;
                                    ?>
                                    <li><a href="#"><?php echo $loaihoa; ?></a></li>     
                                    <?php
                                }
                            }
                            ?>
                        </ul>                        
                    </div>
                    <div class="right_box">
                        <div class="title"><span class="title_icon"><?php echo img(asset_url() . 'imgs/bullet4.gif', TRUE); ?></span>Khuyến Mãi</div>
                        <div class="promo_prod_box">
                            <?php
                            if (isset($hoa)) {
                                $count = 0;
                                foreach ($hoa as $val) {
                                    $val = (object) $val;
                                    $MaHoa = $val->MaHoa;
                                    $TenHoa = $val->TenHoa;
                                    $MaLoaiHoa = $val->MaLoaiHoa;
                                    $MaMauSac = $val->MaMauSac;
                                    $HinhAnh = $val->HinhAnh;
                                    $SoLuong = $val->SoLuong;
                                    $DonGia = $val->DonGia;
                                    ?>

                                    <div class="new_prod_bg" style="margin-bottom: 40px"> 
                                        <span class="new_icon"><?php echo img(asset_url() . 'imgs/promo_icon.gif', TRUE); ?></span> 
                                        <img src="<?php echo asset_url() . "$HinhAnh"; ?>" alt="" class="X" width="150px" border="0" />
                                        <label><?php echo "$TenHoa"; ?></label>
                                        <br/>
                                        <span class="price"><?php echo "$DonGia"; ?></span>
                                    </div>

                                    <?php
                                    $count = $count + 1;
                                    if ($count == 3) {
                                        break;
                                    }
                                }
                            }
                            ?>                        
                        </div>
                    </div>

                    <!--end of right content-->
                    <div class="clear"></div>

                </div>
                <div class="clear"></div>
            </div>
            <!--end of center content-->
            <?php
            include '/layout/footer.php';
            ?>
        </div>

    </body>
</html>
